using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MessageModel : GameModule
{

    public MessageView messageView;

    public MessageData messageData;

    public override void AddAllResponseFun()
    {
        
    }

    public override void OnClose()
    {
        RemoveSelf();
    }


    public override void Open()
    {

        if (messageView=null)
        {
            messageView = GameUi.Instance.ShowView((int)ViewId.MessageUi) as MessageView;
        }
        if (messageView!=null)
        {
            messageView.SetModule(this);
            messageView.SetModuleData(messageData);
            messageView.Initialize();
            messageView.UpdateView();
        }
    }

    public override void RemoveSelf()
    {
        messageView.RemoveSelf();
        messageView = null;
    }
}
